ARG NODE_BASE_IMAGE=node:22-alpine

FROM ${NODE_BASE_IMAGE} as build-stage

WORKDIR /app

RUN npm config set registry https://registry.npmmirror.com

RUN corepack enable
RUN corepack prepare pnpm@10.15.0 --activate

COPY .npmrc package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
